package com.nCoV.EpidemicSurveillance.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import com.nCoV.EpidemicSurveillance.domain.SysPermission;


/** 
* @author 作者 罗穆健: 
* @version 创建时间：2020年1月5日 下午3:38:10 
* 类说明 
*/
@Mapper
public interface SysPermissionMapper {

	@Select("select p.*\r\n" + 
			"    from sys_user u\r\n" + 
			"    LEFT JOIN sys_user_role sur on u.id= sur.uid\r\n" + 
			"    LEFT JOIN sys_role r on sur.rid=r.id\r\n" + 
			"    LEFT JOIN sys_role_permission srp on srp.rid=r.id\r\n" + 
			"    LEFT JOIN sys_permission p on p.id =srp.pid\r\n" + 
			"    where u.id=#{userId}")
	List<SysPermission> findByAdminUserId(String UserId);

	@Select("select id,name,descript,url,pid from sys_permission")
	List<SysPermission> findAll();
}
 